From: Wil Mahan Date: Wed, 22 Sep 2004 21:54:19 +0000 (+0000) Subject: Use OutputPage to replace link placeholders; add links, quotes tests X-Git-Tag: 1.5.0alpha1~1875 X-Git-Url: http://git.cyclocoop.org/%28%5B%5E/404?a=commitdiff_plain;h=faefe215e1484d50ca0b2c8b9f54712290fcafe8;p=lhc%2Fweb%2Fwiklou.git Use OutputPage to replace link placeholders; add links, quotes tests (not working at the moment) --- diff --git a/maintenance/parserTests.php b/maintenance/parserTests.php index 3726d65bb3..3fdd3f287b 100644 --- a/maintenance/parserTests.php +++ b/maintenance/parserTests.php @@ -85,6 +85,9 @@ class ParserTest { $html = $output->getText(); # $languageLinks = $output->getLanguageLinks(); # $categoryLinks = $output->getCategoryLinks(); + + $op = new OutputPage(); + $op->replaceLinkHolders($html); if( $result == rtrim( $html ) ) { return $this->showSuccess( $desc ); diff --git a/maintenance/parserTests.txt b/maintenance/parserTests.txt index 7107def334..d1ae02fd21 100644 --- a/maintenance/parserTests.txt +++ b/maintenance/parserTests.txt @@ -166,21 +166,28 @@ asdfjkl ### External links ### !! test -External links 1 +External links 1-4 !! input Non-bracketed: http://example.com + +Numbered: [http://example.com] + +Specified text: [http://example.com link] + +Trail (not sure if this is meant to work): [http://example.com link]s !! result

Non-bracketed: http://example.com +

Numbered: [1] (http://example.com) +

Specified text: link (http://example.com) +

Trail (not sure if this is meant to work): links (http://example.com)

!! end +# todo: enable these !! test !! disabled External links !! input -Numbered: [http://example.com] -Specified text: [http://example.com link] -Trail (not sure if this is meant to work): [http://example.com link]s Unrecognised characters (for no good reason): http://example.com/1$2345 [http://example.com/1$2345] External image: http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png External image from https: https://meta.wikimedia.org/upload/f/f1/Ncwikicol.png @@ -194,12 +201,6 @@ ja-style clickable images: [http://example.com http://meta.wikimedia.org/upload/ Old & use: http://x&y Escaping without &: http://x&y !! result -

Numbered: [2] (http://example.com)

-

Specified text: link (http://example.com)

-

Trail (not sure if this is meant to work): link (http://example.com)s

Unrecognised characters (for no good reason): http://example.com/1$2345 [http://example.com/1$2345]

External image: test.jpg

@@ -220,3 +221,105 @@ link]

Escaping without &: http://x&y

!! end +### +### Quotes +### + +!! test +Quotes +!! input +Normal text. '''Bold text.''' Normal text. ''Italic text.'' + +'''Bold text.. + +..spanning two paragraphs (should not work).''' + +Normal text. '''''Bold italic text.''''' Normal text. + +'''''Bold italic text '''with bold deactivated''' in between.''''' + +'''''Bold italic text ''with italic deactivated'' in between.''''' + +'''Bold tag left open + +''Italic tag left open + +Normal text. + + +'''This year''''s election ''should'' beat '''last year''''s. + +''Tom'''s car is bigger than ''Susan'''s. +!! result +

Normal text. Bold text. Normal text. Italic text. +

Bold text.. +

..spanning two paragraphs (should not work). +

Normal text. Bold italic text. Normal text. +

Bold italic text with bold deactivated in between. +

Bold italic text with italic deactivated in between. +

Bold tag left open +

Italic tag left open +

Normal text. +

This year's election should beat last year's. +

Toms car is bigger than Susans. +

+!! end + +### +### Internal links +### +!! test +Internal links +!! input +Plain link, capitalized: [[Main Page]] +!! result +

Plain link, capitalized: Main Page +!! end + +!! test +Internal links 2 +!! disabled +!!input +Plain link, uncapitalized: [[main Page]] + +Piped link: [[Main Page|The Main Page]] + +Broken link: [[Zigzagzogzagzig]] + +Link with prefix: XXX[[main Page]], XXX[[Main Page]] + +Link with suffix: [[Main Page]]XXX + +Link with 3 brackets: [[[main page]]] + +Piped link with 3 brackets: [[[main page|the main page]]] + +Link to namespaces: [[Talk:Parser testing]], [[Meta:Disclaimers]] + +Piped link to namespace: [[Meta:Disclaimers|The disclaimers]] + +Link to category: [[:Category:MediaWiki User's Guide]] + +Link to image page: [[:Image:Ncwikicol.png]] + +Plain link to URL: [[http://www.example.org]] + +Piped link to URL: [[http://www.example.org|an example URL]] +!! result +

Plain link, uncapitalized: main Page +

Piped link: The Main Page

+

Broken link: Zigzagzogzagzig

+

Link with prefix: xxxmain Page, xxxMain Page, Xxxmain Page XXXmain Page, XXXMain Page

+

Link with suffix: Main Pagexxx, Main PageXXX

+

Link with 3 brackets: [[[main page]]]

+

Piped link with 3 brackets: [[[main page|the main page]]]

+

Link to namespaces: Talk:Parser testing, +Meta:Disclaimers

+

Piped link to namespace: The disclaimers

+

Link to category: Category:MediaWiki User's Guide

+

Link to image page: Image:Ncwikicol.png

+

Plain link to URL: [[1] (http://www.example.org)]

+

Piped link to URL: an example URL

+!! end